package february.test_2_2;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a = n;
        int b = 0;
        for(int i = 2; i < n ; i++) {
            if(A(i)){
                for(int j = i; j < n; j++) {
                    if(A(j) && i + j == n) {
                        if(j - i < a - b) {
                            a = j;
                            b = i;
                        }
                    }
                }
            }

        }
        System.out.println(b);
        System.out.println(a);
    }
    public static Boolean A(int n) {
        for(int i = 2; i < n/2; i++) {
            if(n % i == 0) {
                return false;
            }
        }
        return true;
    }
}
